{{csrf_field()}}
<div class="layui-form-item">
    <label for="" class="layui-form-label">用户名</label>
    <div class="layui-input-inline">
        <input type="text" name="username" value="{{$admin->username}}" lay-verify="required" placeholder="请输入用户名"
               class="layui-input" readonly>
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">姓名</label>
    <div class="layui-input-inline">
        <input type="text" name="name" value="{{$admin->name}}" lay-verify="required" placeholder="请输入姓名"
               class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">邮箱</label>
    <div class="layui-input-inline">
        <input type="text" name="email" value="{{$admin->email}}" lay-verify="required" placeholder="请输入邮箱" class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">手机号</label>
    <div class="layui-input-inline">
        <input type="text" name="phone" value="{{$admin->phone}}" required="phone" lay-verify="phone"
               placeholder="请输入手机号"
               class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">密码</label>
    <div class="layui-input-inline">
        <input type="password" name="password" lay-verify="" placeholder="请输入密码" class="layui-input">
    </div>
</div>

<div class="layui-form-item">
    <label for="" class="layui-form-label">确认密码</label>
    <div class="layui-input-inline">
        <input type="password" name="password_confirmation" lay-verify="" placeholder="请输入密码"
               class="layui-input">
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">角色：</label>
    <div class="layui-input-inline">
        <select name="role">
            @foreach($roles as $role)
                <option value="{{$role->id}}"
                <?php
                    foreach ($admin->roles as $r) {
                        if ($role->name == $r->name) {
                            echo 'selected = "selected"';
                        }
                    }
                    ?>
                >{{$role->name}}</option>
            @endforeach
        </select>
    </div>
</div>
<div class="layui-form-item">
    <label class="layui-form-label">状态：</label>
    <div class="layui-input-inline">
        <select name="status">
            <option value="1" @if($admin->status == 1) selected @endif >启用</option>
            <option value="2" @if($admin->status == 2) selected @endif>禁用</option>
        </select>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
        <a class="layui-btn" href="{{route('admin.system.user')}}">返 回</a>
    </div>
</div>